{% extends 'evaluation/base_app.html' %}
{% load switchcase %}

{% block content %}

Submission {{submission.id}} ({{submission.title}}) by {{user.username}} to {{submission.to_challenge.name}}.
Submitted {{submission.when}}.
<hr/>
<table>
    <tr><td>
      <b>Method:</b></td><td>{{submission.method}}</td></tr>
    <tr><td>
      <b>Title:</b></td><td>{{submission.title}}</td></tr>
    <tr><td><b>Description:</b></td><td>{{submission.description}}</td></tr>
    <tr><td><b>Contact person:</b></td><td>{{submission.contact_person}}</td></tr>
    <tr><td><b>Affiliation:</b></td><td>{{submission.affiliation}}</td></tr>
    <tr><td><b>Contributors:</b></td><td>{{submission.contributors}}</td></tr>
</table>
<hr/>
<h2>Status</h2>

{{submission.get_state_display}}
{% switch submission.state %}
    {% case 4 %} <b>Evaluation failed.</b><br/>
Please check the error messages below and correct your submission if possible. <br/> 
If the error message seems too cryptic or you don't know what you need to correct, please e-mail the contact for more information (see below). Please use [VOC2009] in the title and copy the URL of this page in your e-mail. Thank you.
 {% endcase %}
{% endswitch %}
<hr/>
<h2>Score</h2>
{% if submission.to_challenge.is_score_visible %} 
{% comment %} Average score: {{submission.score}}. {% endcomment %}

<table>
<tr><th>Competition</th><th>Category</th><th>Score</th></tr>
{%comment%} for score in submission.detailed_scores_from_files {% endcomment %}

{% for score in submission.submissionscore_set.all %}
<tr><td>{{score.competition}}</td><td>{{score.category}}</td><td>{{score.score}}</td></tr>
{% endfor %}
</table>

{% else %}
{{submission.to_challenge}}
The score is not visible for this challenge.
{% endif %} 

<hr/>
<h2>Messages</h2>
{% for m in submission_messages %}
<b>[{{m.when}}]</b> {{m.text}}<br/>
{% endfor %}
<hr/>
<h2>Evaluation errors</h2>
{% for r in err_rpt.readlines %}
{{r}}<br/>
{% endfor %}
<hr/>
<h2>Evaluation log</h2>
{% for r in rpt.readlines %}
{{r}}<br/>
{% endfor %}
<hr/>





{% endblock %}

